//
//  UITableView+EmptyData.m
//  lisure0.1
//
//  Created by xalo on 16/4/22.
//  Copyright © 2016年 Mr.wangYongxu. All rights reserved.
//

#import "UITableView+EmptyData.h"

@implementation UITableView (EmptyData)

- (NSInteger)showMessage:(NSString*)title byDataSourceCount:(NSInteger)count{

    if (count == 0) {

        UIImageView* imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"MenuBackground"]];

        UILabel* lable = [[UILabel alloc] init];
        lable.text = title;
        lable.textAlignment = NSTextAlignmentCenter;
        lable.textColor = [UIColor whiteColor];
        lable.center = imageView.center;
        [imageView addSubview:lable];
        self.backgroundView = imageView;

        self.separatorStyle = UITableViewCellSeparatorStyleNone;
    }else{
        self.separatorStyle = UITableViewCellSeparatorStyleNone;
        self.backgroundView = nil;
    };


    return count;
}

@end
